load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "settingswatcher",
    srcs = [
        "overrides.go",
        "row_decoder.go",
        "setting_encoder.go",
        "settings_watcher.go",
        "version_guard.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/server/settingswatcher",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/clusterversion",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvclient/rangefeed",
        "//pkg/kv/kvclient/rangefeed/rangefeedbuffer",
        "//pkg/kv/kvclient/rangefeed/rangefeedcache",
        "//pkg/kv/kvpb",
        "//pkg/roachpb",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/systemschema",
        "//pkg/sql/rowenc",
        "//pkg/sql/rowenc/valueside",
        "//pkg/sql/sem/tree",
        "//pkg/sql/types",
        "//pkg/util/encoding",
        "//pkg/util/hlc",
        "//pkg/util/log",
        "//pkg/util/log/logcrash",
        "//pkg/util/protoutil",
        "//pkg/util/stop",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
    ],
)

go_test(
    name = "settingswatcher_test",
    srcs = [
        "main_test.go",
        "row_decoder_external_test.go",
        "setting_encoder_test.go",
        "settings_watcher_external_test.go",
        "version_guard_test.go",
    ],
    deps = [
        ":settingswatcher",
        "//pkg/base",
        "//pkg/clusterversion",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvclient/rangefeed",
        "//pkg/kv/kvclient/rangefeed/rangefeedcache",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver",
        "//pkg/roachpb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/sql",
        "//pkg/sql/sem/tree",
        "//pkg/testutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/skip",
        "//pkg/testutils/sqlutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/hlc",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/protoutil",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//require",
    ],
)
